package com.sugon.service.impl;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;
import com.sugon.dao.ErmsKpiWorkshopDao;
import com.sugon.entity.ErmsKpiWorkshopEntity;
import com.sugon.service.ErmsKpiWorkshopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 车间级月度KPI值,主要为PM完成率和PM延期率两个维度Service实现类
 *
 * @author sugon
 * @date 2021-03-24 18:53:33
 */
@Service("ermsKpiWorkshopService")
public class ErmsKpiWorkshopServiceImpl implements ErmsKpiWorkshopService {
    @Autowired
    private ErmsKpiWorkshopDao ermsKpiWorkshopDao;

    @Override
    public int save(ErmsKpiWorkshopEntity ermsKpiWorkshop) {
        ermsKpiWorkshop.setId(RandomUtil.randomString(32));
        ermsKpiWorkshop.setGmtCreate(DateUtil.date());
        return ermsKpiWorkshopDao.save(ermsKpiWorkshop);
    }

}
